package org.andrewwinter.tescopricewar;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class AppProperties
{
    private final Properties properties;

    public AppProperties() throws IOException {
        final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("app.properties");
        if (is == null) {
            throw new RuntimeException("Could not find app.properties");
        }
        properties = new Properties();
        properties.load(is);
    }

    public String getEmail() {
        return properties.getProperty("email");
    }

    public String getPassword() {
        return properties.getProperty("password");
    }
}
